package sort;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-04-14
 * Time：14:23
 */
public class TestMySort {
    public static void main(String[] args) {
        int[]array={3,8,1,9,6,10,5,2,7,4};

        System.out.println("========排序前=======");
        System.out.println(Arrays.toString(array));

        int[]array1= Arrays.copyOf(array,array.length);
        System.out.println("======插入排序======");
        MySort.insertSort(array1);
        System.out.println(Arrays.toString(array1));


        System.out.println("=========希尔排序========");
        int[]array2= Arrays.copyOf(array,array.length);
        MySort.shellSort(array2);
        System.out.println(Arrays.toString(array2));


        System.out.println("=======选择排序=======");
        int[]array3= Arrays.copyOf(array,array.length);
        MySort.selectSort2(array3);
        System.out.println(Arrays.toString(array3));

        System.out.println("=========堆排序=======");
        int[]array4= Arrays.copyOf(array,array.length);
        MySort.heapSort(array4);
        System.out.println(Arrays.toString(array4));

        System.out.println("==========冒泡排序==========");
        int[]array5= Arrays.copyOf(array,array.length);
        MySort.bubbleSort(array5);
        System.out.println(Arrays.toString(array5));


    }
}
